<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>4_2_1-常用事件类型</title>
</head>

<body>


  <!--载入vue.js-->
  <script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>

  <div id="Application">
    <div @click="click">单击事件</div>
    <div @dblclick="dblclick">双击事件</div>
    <input @focus="focus" @blur="blur" @change="change" @select="select" />
    <div @mousedown="mousedown">鼠标按下</div>
    <div @mouseup="mouseup">鼠标抬起</div>
    <div @mousemove="mousemove">鼠标移动</div>
    <div @mouseout="mouseout" @mouseover="mouseover">鼠标移入移出</div>
    <input @keydown="keydown" @keyup="keyup" />

    <h1>按键修饰符</h1>
  </div>

  <script>
    //定义组件
    const App = {
      //组件的data方法
      data() {
        //返回对象
        return {};
      },
      //计算属性
      computed: {},

      //定义组件的函数
      methods: {
        click() {
          console.log("单击事件");
        },

        dblclick() {
          console.log("双击事件");
        },

        focus() {
          console.log("获取焦点");
        },

        blur() {
          console.log("失去焦点");
        },

        change() {
          console.log("内容改变");
        },

        select() {
          console.log("文本选中");
        },

        mousedown() {
          console.log("鼠标按键按下");
        },

        mouseup() {
          console.log("鼠标按键抬起");
        },

        mousemove() {
          console.log("鼠标移动");
        },

        mouseout() {
          console.log("鼠标移出");
        },

        mouseover() {
          console.log("鼠标移入");
        },

        keydown() {
          console.log("键盘按键按下");
        },
      },
    };

    Vue.createApp(App).mount("#Application");
  </script>
</body>

</html>